package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.ByUserCharge;
import com.ruoyi.system.domain.vo.StaticVo;
import com.ruoyi.system.mapper.ByUserChargeMapper;
import com.ruoyi.system.service.IByUserChargeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: Zhangyuting
 * @Desctription: TODO
 * @Date: Created in 2024/12/18 20:38
 * @Version: 1.0
 */
@Service
public class ByUserChargeServiceImpl implements IByUserChargeService {

    @Autowired
    private ByUserChargeMapper byUserChargeMapper;

    /**
     * 查询【请填写功能名称】
     *
     * @param id 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public ByUserCharge selectByUserChargeById(Long id)
    {
        return byUserChargeMapper.selectByUserChargeById(id);
    }

    /**
     * 查询【请填写功能名称】列表
     *
     * @param byUserCharge 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<ByUserCharge> selectByUserChargeList(ByUserCharge byUserCharge)
    {
        List<ByUserCharge> list = byUserChargeMapper.selectByUserChargeList(byUserCharge);
        return list;
    }

    /**
     * 新增【请填写功能名称】
     *
     * @param byUserCharge 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertByUserCharge(ByUserCharge byUserCharge)
    {
        byUserCharge.setCreateTime(DateUtils.getNowDate());
        return byUserChargeMapper.insertByUserCharge(byUserCharge);
    }

    /**
     * 修改【请填写功能名称】
     *
     * @param byUserCharge 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateByUserCharge(ByUserCharge byUserCharge)
    {
        return byUserChargeMapper.updateByUserCharge(byUserCharge);
    }

    /**
     * 批量删除【请填写功能名称】
     *
     * @param ids 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteByUserChargeByIds(Long[] ids)
    {
        return byUserChargeMapper.deleteByUserChargeByIds(ids);
    }

    /**
     * 删除【请填写功能名称】信息
     *
     * @param id 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteByUserChargeById(Long id)
    {
        return byUserChargeMapper.deleteByUserChargeById(id);
    }

    @Override
    public List<StaticVo> getMonth(String beginTime, String endTime) {
        return byUserChargeMapper.getMonth(beginTime,endTime);
    }


}
